#include "Barracks.h"
#include "IS.h"
#include "ShareComponents.h"
#include "GameDefine.h"
#include "Camera.h"
#include "Box.h"
#include <d3dx9.h>
#include "MainGame.h"
#include <stdlib.h>
Barracks::Barracks(Box*	box) :  Object(box)
{
}


Barracks::~Barracks(void)
{
}

void Barracks::init()
{
	delay = 0;
	_isAlive = true;
	_obj = ObjBarracks;
}

void Barracks::update()
{
	delay += GAME_TIME;
	if(delay > 1000)
	{
		//////
		//tao cac is o day
		float right = gl_camera->getRightSide() - 50 ;		
		IS* is = new IS(new Box(D3DXVECTOR2(right,_box->_position.y),D3DXVECTOR2(0,0),D3DXVECTOR2(-IS_MOVE_VEC,0)));
		is->init();
		gl_MainGame->addWorldObject(is);
		delay = 0;
	}
}

Box* Barracks::getCollisionBox()
{
	return NULL;
}


